The Undo Buffer

The imaG control has four UNDO/REDO buffers, two for DRAW MODE and two for EDIT MODE.

The depth of the buffers depends of the size of the image (4 to 8).

In EDIT MODE the buffer is automatically set.

UNDO/REDO ACTIONS IN EDIT MODE CONSTANTS
Pen caUndoPen = 1
Brush caUndoBrush = 2
Eraser caUndoEraser = 3
Fill caUndoFill = 4
Line caUndoLine = 5
Rectangle caUndoRectangle = 6
Filled Rectangle caUndoRectangleFilled = 7
Round Rectangle caUndoRoundRectangle
Filled Round Rectangle caUndoRoundRectangleFilled = 9
Ellipse caUndoEllipse = 10
Filled Ellipse caUndoEllipseFilled = 11
Cut caUndoCut = 12
Paste caUndoPaste = 13
Delete caUndoDelete = 14

In DRAW MODE the buffer is automatically set for some actions and is also programmable.

UNDO/REDO ACTIONS IN DRAW MODE CONSTANTS
Cut caUndoCut = 12
Paste caUndoPaste = 13
Delete caUndoDelete = 14
Draw Line caUndoDrawLine = 15
Draw Text caUndoDrawText = 16
Draw Point caUndoDrawPoint = 17
Draw Circle caUndoDrawCircle = 18
Mirror Horizontal caUndoMirror = 19
Mirror Vertical caUndoFlip = 20
Rotate 180º caUndoRotateDown = 21
Edit caUndoEdit = 22

When the imaG is turned to EDIT MODE the image (in DRAW MODE) is saved to the buffer.

The DRAW MODE Buffer will be cleared when changing the color depth.
The DRAW MODE Buffer will be cleared when changing the size of the image (Rotate +- 90º , ...)

The EDIT MODE Buffer will be cleared when turning from edit mode to draw mode.

With the Test property set to TRUE , all the UNDO/REDO actions will NOT effective to avoid large memory spaces.

PROGRAMMING THE UNDO BUFFER.

In DRAW MODE the UNDO/REDO buffer is programmable.

Before the image changes :

imaG.Undo_Add UndoName

After the image changes

PctureX.Undo_AddPalette (saves the redo palette)

UNDO-REDO ACTION.

imaG.Undo_Query (parameters ...) - presets the Undo/Redo buffer and returns the undo/redo values for recognizing the action

imaG.Undo_Undo or
imaG.Undo_Redo

Copyright © Carlos Acerbi